package sg.edu.nus.iss.phoenix.authenticate.delegate;

import sg.edu.nus.iss.phoenix.authenticate.entity.User;
import sg.edu.nus.iss.phoenix.authenticate.service.AuthenticateService;

public class AuthenticateDelegate {
	private AuthenticateService service;

    /**
     * constructor
     */
    public AuthenticateDelegate() {
        super();
		service = new AuthenticateService();
	}

    /**
     * validate user login ID and password, if success, return found user, else return null
     *
     * @param user
     * @return user if success, null if fail
     */
    public User validateUserIdPassword(User user) {
        return service.validateUserIdPassword(user);
    }

    /**
     * grand access for user
     *
     * @param user
     * @return updated user
     */
    public User evaluateAccessPreviledge(User user) {
        return service.evaluateAccessPreviledge(user);
	}
	
}
